package com.wjh.base;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 返回码定义
 * 
 * @author wenjianhai
 * @date 2023/5/8
 * @since JDK 17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
public class ResponseApiCode {

    private String code;
    private String message;

    public ResponseApiCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static final String SUCCESS_CODE = "200";
    public static final ResponseApiCode SUCCESS = new ResponseApiCode("200", "成功");
    public static final ResponseApiCode SYSTEM_ERROR = new ResponseApiCode("E00001", "系统错误");
    public static final ResponseApiCode PARAMETER_ERROR = new ResponseApiCode("E00002", "请求参数错误");
    public static final ResponseApiCode IMAGE_FORMAT_ERROR = new ResponseApiCode("E00003", "图片格式不合法");
    public static final ResponseApiCode FILE_EXISTS_ERROR = new ResponseApiCode("E00004", "文件已经存在");
    public static final ResponseApiCode FILE_NOT_EXISTS_ERROR = new ResponseApiCode("E00005", "文件不存在");
    public static final ResponseApiCode VALIDATE_FAILURE = new ResponseApiCode("E00006", "验证失败");
    public static final ResponseApiCode NOT_LOGIN = new ResponseApiCode("E00007", "您还未登录");
    public static final ResponseApiCode EXPIRED = new ResponseApiCode("E00008", "表单过期，请刷新");
    public static final ResponseApiCode PERMISSION_DENIED = new ResponseApiCode("E00009", "权限不足");
    public static final ResponseApiCode SMS_TIMES_LIMIT = new ResponseApiCode("E00010", "短信发送次数超过限制");
    public static final ResponseApiCode SMS_SENDING_INTERVAL_LIMIT = new ResponseApiCode("E00011", "短信发送时间间隔过短");
    public static final ResponseApiCode NETWORK_ERROR = new ResponseApiCode("E00012", "网络异常");
    public static final ResponseApiCode OPERATION_TIMES_LIMIT = new ResponseApiCode("E00013", "操作次数超过限制");
    public static final ResponseApiCode SERVICE_ERROR = new ResponseApiCode("E00014", "服务逻辑异常");
    public static final ResponseApiCode REDIS_TRY_LOCK_ERROR = new ResponseApiCode("E00015", "redisson加锁异样");
    public static final ResponseApiCode REDIS_LOCK_OCCUPY_ERROR = new ResponseApiCode("E00016", "redis锁已经被占用");
    public static final ResponseApiCode SILVER_BEAN_DEFICIENCY_ERROR = new ResponseApiCode("E00017", "种子不足");
    public static final ResponseApiCode TRANS_CANCEL_NOT_ONESELF = new ResponseApiCode("E00018", "操作非本人");
    public static final ResponseApiCode REPEAT_OPT = new ResponseApiCode("E00019", "请勿重复操作");
    public static final ResponseApiCode BUSINESS_ERROR = new ResponseApiCode("E99999", "业务自定义异常");
}
